package org.example;

import com.baomidou.mybatisplus.generator.FastAutoGenerator;
import com.baomidou.mybatisplus.generator.engine.FreemarkerTemplateEngine;

import java.nio.file.Paths;

public class Test {
        public static void main(String[] args) {
                String url = "jdbc:mysql://localhost:3306/blog2024";
                String username = "root";
                String password = "root";
                FastAutoGenerator.create(url,username,password)
                        .globalConfig(builder -> {
                                builder.author("袁龙林").outputDir("src\\main\\java");
                        })
                        .packageConfig(builder -> {
                                builder.parent("org.example").entity("entity.domain");
                        })
                        .strategyConfig(builder -> {
                                builder.addInclude("blog","comment","blog_friend","message","music","sys_config","sys_log","tag","type","user","views")
                                        .entityBuilder().enableLombok().enableTableFieldAnnotation();
                        })
                        .execute();
        }
}
